namespace BTSPracCourse.Pipelines.FlatFileGS
{
    using System;
    using System.Collections.Generic;
    using Microsoft.BizTalk.PipelineOM;
    using Microsoft.BizTalk.Component;
    using Microsoft.BizTalk.Component.Interop;
    
    
    public sealed class GreenShieldReceivePipeline : Microsoft.BizTalk.PipelineOM.ReceivePipeline
    {
        
        private const string _strPipeline = "<?xml version=\"1.0\" encoding=\"utf-16\"?><Document xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instanc"+
"e\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" MajorVersion=\"1\" MinorVersion=\"0\">  <Description /> "+
" <CategoryId>f66b9f5e-43ff-4f5f-ba46-885348ae1b4e</CategoryId>  <FriendlyName>Receive</FriendlyName>"+
"  <Stages>    <Stage>      <PolicyFileStage _locAttrData=\"Name\" _locID=\"1\" Name=\"Decode\" minOccurs=\""+
"0\" maxOccurs=\"-1\" execMethod=\"All\" stageId=\"9d0e4103-4cce-4536-83fa-4a5040674ad6\" />      <Component"+
"s>        <Component>          <Name>BTSPracCourse.PipeLines.PipeLineComponents.GreenShieldCleanComp"+
"onent,BTPracCourse.PipeLines.PipeLineComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e5"+
"6921b90feec973</Name>          <ComponentName>GreenShield Cleaner Component</ComponentName>         "+
" <Description>BizTalk 2006 Pipeline component</Description>          <Version>1.0.0.0</Version>     "+
"     <Properties>            <Property Name=\"RecLength\">              <Value xsi:type=\"xsd:string\">1"+
"87</Value>            </Property>          </Properties>          <CachedDisplayName>GreenShield Cle"+
"aner Component</CachedDisplayName>          <CachedIsManaged>true</CachedIsManaged>        </Compone"+
"nt>      </Components>    </Stage>    <Stage>      <PolicyFileStage _locAttrData=\"Name\" _locID=\"2\" N"+
"ame=\"Disassemble\" minOccurs=\"0\" maxOccurs=\"-1\" execMethod=\"FirstMatch\" stageId=\"9d0e4105-4cce-4536-8"+
"3fa-4a5040674ad6\" />      <Components>        <Component>          <Name>Microsoft.BizTalk.Component"+
".FFDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken="+
"31bf3856ad364e35</Name>          <ComponentName>Flat file disassembler</ComponentName>          <Des"+
"cription>Streaming flat file disassembler component</Description>          <Version>1.0</Version>   "+
"       <Properties>            <Property Name=\"HeaderSpecName\" />            <Property Name=\"Documen"+
"tSpecName\">              <Value xsi:type=\"xsd:string\">BTSPracCourse.Schemas.Sample.GreenShieldFlatFi"+
"leSchema, BTSPracCourse.Schemas.Sample, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e56921b90fe"+
"ec973</Value>            </Property>            <Property Name=\"TrailerSpecName\" />            <Prop"+
"erty Name=\"PreserveHeader\">              <Value xsi:type=\"xsd:boolean\">false</Value>            </Pr"+
"operty>            <Property Name=\"ValidateDocumentStructure\">              <Value xsi:type=\"xsd:boo"+
"lean\">false</Value>            </Property>            <Property Name=\"RecoverableInterchangeProcessi"+
"ng\">              <Value xsi:type=\"xsd:boolean\">false</Value>            </Property>          </Prop"+
"erties>          <CachedDisplayName>Flat file disassembler</CachedDisplayName>          <CachedIsMan"+
"aged>true</CachedIsManaged>        </Component>      </Components>    </Stage>    <Stage>      <Poli"+
"cyFileStage _locAttrData=\"Name\" _locID=\"3\" Name=\"Validate\" minOccurs=\"0\" maxOccurs=\"-1\" execMethod=\""+
"All\" stageId=\"9d0e410d-4cce-4536-83fa-4a5040674ad6\" />      <Components />    </Stage>    <Stage>   "+
"   <PolicyFileStage _locAttrData=\"Name\" _locID=\"4\" Name=\"ResolveParty\" minOccurs=\"0\" maxOccurs=\"-1\" "+
"execMethod=\"All\" stageId=\"9d0e410e-4cce-4536-83fa-4a5040674ad6\" />      <Components />    </Stage>  "+
"</Stages></Document>";
        
        private const string _versionDependentGuid = "ad80bfcd-9353-481b-8e40-1a8bd8a4deab";
        
        public GreenShieldReceivePipeline()
        {
            Microsoft.BizTalk.PipelineOM.Stage stage = this.AddStage(new System.Guid("9d0e4103-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.all);
            IBaseComponent comp0 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("BTSPracCourse.PipeLines.PipeLineComponents.GreenShieldCleanComponent,BTPracCourse.PipeLines.PipeLineComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e56921b90feec973");;
            if (comp0 is IPersistPropertyBag)
            {
                string comp0XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst"+
"ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">  <Properties>    <Property Name=\"RecLength\">    "+
"  <Value xsi:type=\"xsd:string\">187</Value>    </Property>  </Properties></PropertyBag>";
                PropertyBag pb = PropertyBag.DeserializeFromXml(comp0XmlProperties);;
                ((IPersistPropertyBag)(comp0)).Load(pb, 0);
            }
            this.AddComponent(stage, comp0);
            stage = this.AddStage(new System.Guid("9d0e4105-4cce-4536-83fa-4a5040674ad6"), Microsoft.BizTalk.PipelineOM.ExecutionMode.firstRecognized);
            IBaseComponent comp1 = Microsoft.BizTalk.PipelineOM.PipelineManager.CreateComponent("Microsoft.BizTalk.Component.FFDasmComp,Microsoft.BizTalk.Pipeline.Components, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");;
            if (comp1 is IPersistPropertyBag)
            {
                string comp1XmlProperties = "<?xml version=\"1.0\" encoding=\"utf-16\"?><PropertyBag xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-inst"+
"ance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">  <Properties>    <Property Name=\"HeaderSpecName\""+
" />    <Property Name=\"DocumentSpecName\">      <Value xsi:type=\"xsd:string\">BTSPracCourse.Schemas.Sa"+
"mple.GreenShieldFlatFileSchema, BTSPracCourse.Schemas.Sample, Version=1.0.0.0, Culture=neutral, Publ"+
"icKeyToken=e56921b90feec973</Value>    </Property>    <Property Name=\"TrailerSpecName\" />    <Proper"+
"ty Name=\"PreserveHeader\">      <Value xsi:type=\"xsd:boolean\">false</Value>    </Property>    <Proper"+
"ty Name=\"ValidateDocumentStructure\">      <Value xsi:type=\"xsd:boolean\">false</Value>    </Property>"+
"    <Property Name=\"RecoverableInterchangeProcessing\">      <Value xsi:type=\"xsd:boolean\">false</Val"+
"ue>    </Property>  </Properties></PropertyBag>";
                PropertyBag pb = PropertyBag.DeserializeFromXml(comp1XmlProperties);;
                ((IPersistPropertyBag)(comp1)).Load(pb, 0);
            }
            this.AddComponent(stage, comp1);
        }
        
        public override string XmlContent
        {
            get
            {
                return _strPipeline;
            }
        }
        
        public override System.Guid VersionDependentGuid
        {
            get
            {
                return new System.Guid(_versionDependentGuid);
            }
        }
    }
}
